﻿using System.Web.Mvc;
using ECG.WebUI.Infrastructure;

namespace ECG.WebUI.Attributes
{
    public class AdminLoggedAuthorize : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.HttpContext.Session[SessionConfig.SessionAdminLogged] == null)
            {
                filterContext.Result = new RedirectResult("/Admin/AdminLogin/Login");
            }
        }
    }
}